using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using CMS.Core.DataInterfaces;
using CMS.Core.Domain;
using CMS.Data;
using AjaxPro;
using CMS.Presenters.Views.Reports;

namespace CMS.Presenters.Presenters
{
    public class LookupAllPresenter
    {
        IDonThuDao iDonThuDao;
        ILookupAllView iLookupView;

        public LookupAllPresenter()
        { 
        
        }

        public LookupAllPresenter(ILookupAllView iLookupView)
        {
            this.iLookupView = iLookupView;
            this.iLookupView.LinhVucs = PhongBanDao.Instance.GetAllWithMoreFieldsAndOderBy(true, new string[] { "TrangThai" }, new object[] { true }, new string[] { "ThuTu" }, true);
            this.iLookupView.LoaiDons = LoaiDonDao.Instance.GetAllWithMoreFieldsAndOderBy(true, new string[] { "TrangThai" }, new object[] { true }, new string[] { "ThuTu" }, true);
        }

        [AjaxMethod]
        public IList SearchDonThus(string type, String txt1, String txt2, String txtNgay1, String txtNgay2,
            String maPB, int maLoaiDon, String maDiaBan, int State,
            int min, int max
            )
        {
            this.iDonThuDao = new DonThuDao();
            return this.iDonThuDao.SearchDonThuVangLais(type, txt1,txt2, txtNgay1, txtNgay2,
               maPB, maLoaiDon, maDiaBan, State, min, max);
        }

        [AjaxMethod]
        public IList TotalSearchDonThus(string type, String txt1, String txt2,
            String txtNgay1, String txtNgay2, String maPhongBan, int maLoaiDon, String maDiaBan, int State
            )
        {
            this.iDonThuDao = new DonThuDao();
            return this.iDonThuDao.TotalSearchDonThuVangLais(type, txt1,txt2, txtNgay1, txtNgay2,
                maPhongBan, maLoaiDon, maDiaBan, State);
        }    
    }
}
